<?php

class soin_Model extends CI_Model{
    
    public function __construct(){
        parent::__construct(); 
        $this->load->database();
        
   }
   
   public function getSoinByUserId($id){
 
        $this->db->select('media.lien_url');
        $this->db->select('soin.description,soin.carte_soin');
        $this->db->from('soin');
        $this->db->where('partenaire_id	', $id);
        $this->db->join('media', 'media.id = soin.media_id');
        
            
        $query = $this->db->get();
        // echo $this->db->last_query();
          //   exit;
   
        if ($query->num_rows() == 1) {
            foreach ($query->result() as $row) {
                $data[] = $row;
            }
             return $data[0];
        }
        else
        {
            return false;
        }
   }
    
    
}
?>
